import java.util.Arrays;
import java.util.Scanner;
public class t7 {
    public static void main(String[] args){
        //输入123 返回321    -123输出-321 0输出0
        Scanner scan = new Scanner(System.in);
        System.out.println(" 输入数值");
        int num =scan.nextInt();
        //int num =123456;
        int q = num;
        if(num<=0){
            num = -num;
        }
        int k =num;
        int x = 1;
        for(int i =0 ; true ;i++)
        if(num/10==0){
            break;
        }else {
            num = num / 10;
            x++;
        }

        int [] arr = new int[x];
        double b = 0.1;
        int a =0;
        a =k/1%10;
        //System.out.println(a);

        for(int i =0 ; i<=arr.length-1; i++){
            int c = 0;
               b *= 10;
            c = (int)b;
            arr[i] = k/c%10;
        }
        //System.out.println(Arrays.toString(arr));
        double w= 0.1;
        int brr [] = new int [arr.length];
        long p = 0;
        for(int i = arr.length-1 ;i>=0;i--){
            int e = 0;
            w *= 10;
            e =(int)w;
            p += (long)arr[i] *e;
        }
        System.out.println(p);
        //long i = 2147483648L;
        if(q>0 && p<=2147483647){
            System.out.println(p);
        }else if(p>2147483647) {
            System.out.println(0);
        }else if(q<0 && p>-2147483648){
            System.out.println(-p);
        }else {
            System.out.println(0);
        }

    }
}
